class Position:
    x = 0
    y = 0

    def __init__(self, X, Y):
        self.x, self.y = X, Y  # 必须写成self.x,否则x是一个新的对象，将覆盖self.x

    def __eq__(self, other):  # 重载== !=函数，self和other可能是None
        if other and self:
            return self.x == other.x and self.y == other.y
        else:
            return not (self or other)
